package com.open.capacity.config;


import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000117691183";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCPa5+4qituML2+TxVPR1iqwvTtdjHMrwWupAodbXvZA0IuLzLyXTsdD3nzaRvVFI+IBxay/EYPWyhlSTMXtRjVUrrwS5FYJDH5twLFuvweuI++Q7oCWurFYyjzIwqhvykUIPnDvBdZvfpjgCiJPkKyRNjVq8cucIrrgbB1PVb4fi5Pb06KAJhtX2DIKXdVj6fsr1ja2sYv9ziuE7wUAq0+HgBo88Ozqaw1WAyk12/9Q2C7bayx6XJhfpNg3ZgyfYNV58DDJhEG77WDBluhq/adoQIAY4RRj5W5lImFBm9mwT39lMK6YTPo8+RTJfQ+tmRQulylj6TRSzKaGtwU8Y0HAgMBAAECggEAZQ0PnK1JrHnrNwvBl/pNHwP+TtHYhL9M4Z/zAIkDmgQRvTjETMAjxnYBFuAYHCpAdzeHZtUZB/jSnYrV1P5kYOnJjUWxQsk97RRlf6wfuAWSQhy2ErK8eBdF4wntk8l8yBHz6VW9nh2dLj4+UXTsyW542RQPY0komIboLbLqdGpkAYXRWpJZBGJ04A2DX4eK9XzoaC9HKr/wdhe0F4biR/eZ5lxbCw8KDbQdJ+4UEj5UauOfaMhAizSvZ/lHyG7DHtOEgHreqxn/V9jegAM+Z7IYPybARsaqplXjolHOhIDrsSPaYKhPS8XJpQKzDXfY3ayDb8sFKeJezNKRLsQdAQKBgQDUdNkni7K0FKzCI1Cmdv5dY+LYw65d7pvRmgHSW+4+IRqv4lQjtMT12ak7atGjoK6v8dVi5BrRYeGtIpQGoghwo23po1ON+pLb/5Nf+TgU+hxRBZdGhkVmN8lFpuxqemCo1XNxiDf2kHtzcfqwB8o//p7akILZjVX5CZyQ5bwzswKBgQCs0Jji3dFrlTgRacG73OkM0BLEAnZ6j7toMrdg2ljyqvkxIsv4IF4esTQrBGISnQ4tobjf0o4AKKdldqevW/81v6fysGnYhqM5CZznpn3TNUGhoICrLhFRf06rVvmjOaRDRX5kgihDnvZIMXdrJ5rak7f52mzVQwdzI0qAZkOnXQKBgATpSpfSb+gfzjqSrGuctpacF4NhSqebO3jl8YLWYzSGeWJ1ffJxXFg+lt3rwzrgHQmuMnudwEz00U26Tee1WTKZZJIRF35hu4FgcBy42yYI/hyVX4De273YLkvw5ugzOgbNIGUQfBK0FlZ93QiytWczUKLG0m+LB+DA6yCiXu5nAoGAWvJko3BNWCrtmOxpUq7NzzppxdHt/E5MOGgIbeY7TWqBPkSrx2dxYQGtDL5/xn/1CDrGCrTKmnbKsfEiCn2F8AlvH5+L9LHWkJvogVjzewXaBm9rh6r03kj7Y9ygADDDq8uU2txMyFmODyxJRpFPQ5zeA5XaFNnzv7pg6PXowNkCgYAwv1VaDRUFtpDxYuje6DufQaBVcIdprlLSf3Z/B72wHN9yx3Qk8oZ95zGmUDZzsRFuZt9odTDC8lQIMd6PN6MFknllZrsesqpbZ2e1j/EZyP47QYBLw8iyC6BQ3Ts4Kjze648m57AX9gbL64ilLrvOVTa44XatysxRf5iumrac+g==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoc0ELX4UPrSvaWgqGPjRtp3e+FG+HhQys4HeHmjCVIqXsPJ+AJIDR/AUIpz5QemihbwZKwivm35G+hA9vDaGNrZyJa1wL1YlRA5JNrUO8QcirHa9DxuZy2QeQUaYqL5D0krCyK70lKUCPL/LZ46DTNX01EefO/dYk4dJEXl/VsjJTYPRbx3/rEjmAJzePWcEeN+DCVQqP/EDKg+rsUyw+t8Bh0eRVf9NYFVb10GqGBE8YkmCc9SrJZpxpZ8ymj4O5L73m/oeFrE6TsRhHxtVR6SaX8TAaHGfaQyYHDUJkElhUpyqhYRMHJs+lS7CK6UzJoDmfpfjZsxmbv0xd99IZwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "www.baidu.com";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "www.baidu.com";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

